home *** CD-ROM | disk | FTP | other *** search
/ Complete Internet Archive / Complete Internet Archive.iso / Winsock Libraries / ipack(2).exe / FTPCONNE.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-12-12  |  6.1 KB  |  196 lines

  1. VERSION 2.00
  2. Begin Form frmConnection 
  3.    BackColor       =   &H00C0C0C0&
  4.    ClientHeight    =   3000
  5.    ClientLeft      =   1740
  6.    ClientTop       =   2835
  7.    ClientWidth     =   3645
  8.    ControlBox      =   0   'False
  9.    Height          =   3405
  10.    Left            =   1680
  11.    LinkTopic       =   "Form2"
  12.    MaxButton       =   0   'False
  13.    MDIChild        =   -1  'True
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   3000
  16.    ScaleWidth      =   3645
  17.    Top             =   2490
  18.    Width           =   3765
  19.    WindowState     =   2  'Maximized
  20.    Begin CommandButton cmdConnect 
  21.       Caption         =   "Connect"
  22.       FontBold        =   0   'False
  23.       FontItalic      =   0   'False
  24.       FontName        =   "MS Sans Serif"
  25.       FontSize        =   8.25
  26.       FontStrikethru  =   0   'False
  27.       FontUnderline   =   0   'False
  28.       Height          =   375
  29.       Left            =   105
  30.       TabIndex        =   6
  31.       Top             =   1725
  32.       Width           =   975
  33.    End
  34.    Begin CommandButton cmdDisconnect 
  35.       Caption         =   "Disconnect"
  36.       Enabled         =   0   'False
  37.       FontBold        =   0   'False
  38.       FontItalic      =   0   'False
  39.       FontName        =   "MS Sans Serif"
  40.       FontSize        =   8.25
  41.       FontStrikethru  =   0   'False
  42.       FontUnderline   =   0   'False
  43.       Height          =   375
  44.       Left            =   1185
  45.       TabIndex        =   5
  46.       Top             =   1725
  47.       Width           =   975
  48.    End
  49.    Begin CommandButton cmdReinit 
  50.       Caption         =   "Reinit"
  51.       Enabled         =   0   'False
  52.       FontBold        =   0   'False
  53.       FontItalic      =   0   'False
  54.       FontName        =   "MS Sans Serif"
  55.       FontSize        =   8.25
  56.       FontStrikethru  =   0   'False
  57.       FontUnderline   =   0   'False
  58.       Height          =   375
  59.       Left            =   2265
  60.       TabIndex        =   4
  61.       Top             =   1725
  62.       Width           =   975
  63.    End
  64.    Begin TextBox txtHost 
  65.       Height          =   285
  66.       Left            =   1065
  67.       TabIndex        =   3
  68.       Top             =   45
  69.       Width           =   2175
  70.    End
  71.    Begin TextBox txtUsername 
  72.       Height          =   285
  73.       Left            =   1065
  74.       TabIndex        =   2
  75.       Top             =   405
  76.       Width           =   2175
  77.    End
  78.    Begin TextBox txtPassword 
  79.       Height          =   285
  80.       Left            =   1065
  81.       TabIndex        =   1
  82.       Top             =   765
  83.       Width           =   2175
  84.    End
  85.    Begin TextBox txtAccount 
  86.       Height          =   285
  87.       Left            =   1065
  88.       TabIndex        =   0
  89.       Top             =   1125
  90.       Width           =   2175
  91.    End
  92.    Begin Timer Timer1 
  93.       Interval        =   100
  94.       Left            =   105
  95.       Top             =   2325
  96.    End
  97.    Begin Label Label1 
  98.       Alignment       =   1  'Right Justify
  99.       BackColor       =   &H00C0C0C0&
  100.       Caption         =   "Host:"
  101.       FontBold        =   0   'False
  102.       FontItalic      =   0   'False
  103.       FontName        =   "MS Sans Serif"
  104.       FontSize        =   8.25
  105.       FontStrikethru  =   0   'False
  106.       FontUnderline   =   0   'False
  107.       Height          =   255
  108.       Left            =   105
  109.       TabIndex        =   10
  110.       Top             =   45
  111.       Width           =   855
  112.    End
  113.    Begin Label Label2 
  114.       Alignment       =   1  'Right Justify
  115.       BackColor       =   &H00C0C0C0&
  116.       Caption         =   "Username:"
  117.       FontBold        =   0   'False
  118.       FontItalic      =   0   'False
  119.       FontName        =   "MS Sans Serif"
  120.       FontSize        =   8.25
  121.       FontStrikethru  =   0   'False
  122.       FontUnderline   =   0   'False
  123.       Height          =   255
  124.       Left            =   105
  125.       TabIndex        =   9
  126.       Top             =   405
  127.       Width           =   855
  128.    End
  129.    Begin Label Label3 
  130.       Alignment       =   1  'Right Justify
  131.       BackColor       =   &H00C0C0C0&
  132.       Caption         =   "Password:"
  133.       FontBold        =   0   'False
  134.       FontItalic      =   0   'False
  135.       FontName        =   "MS Sans Serif"
  136.       FontSize        =   8.25
  137.       FontStrikethru  =   0   'False
  138.       FontUnderline   =   0   'False
  139.       Height          =   255
  140.       Left            =   105
  141.       TabIndex        =   8
  142.       Top             =   765
  143.       Width           =   855
  144.    End
  145.    Begin Label Label4 
  146.       Alignment       =   1  'Right Justify
  147.       BackColor       =   &H00C0C0C0&
  148.       Caption         =   "Account:"
  149.       FontBold        =   0   'False
  150.       FontItalic      =   0   'False
  151.       FontName        =   "MS Sans Serif"
  152.       FontSize        =   8.25
  153.       FontStrikethru  =   0   'False
  154.       FontUnderline   =   0   'False
  155.       Height          =   255
  156.       Left            =   105
  157.       TabIndex        =   7
  158.       Top             =   1125
  159.       Width           =   855
  160.    End
  161. Option Explicit
  162. Dim fConnected As Integer
  163. Private Sub cmdConnect_Click ()
  164.     MainForm.Ftp1.Host = txtHost.Text
  165.     MainForm.Ftp1.LogonName = txtUsername.Text
  166.     MainForm.Ftp1.LogonPassword = txtPassword.Text
  167.     MainForm.Ftp1.Account = txtAccount.Text
  168.     MainForm.Ftp1.Action = FtpActionConnect
  169. End Sub
  170. Private Sub cmdDisconnect_Click ()
  171.         MainForm.Ftp1.Action = FtpActionDisconnect
  172. End Sub
  173. Private Sub cmdReinit_Click ()
  174.     MainForm.Ftp1.Action = FtpActionReinitialize
  175. End Sub
  176. Private Sub Form_Load ()
  177.     txtHost.Text = "ftp.mabry.com"
  178.     txtUsername.Text = "anonymous"
  179.     txtPassword.Text = "test@ftp.ocx"
  180.     fConnected = False
  181.     Me.Show
  182. End Sub
  183. Private Sub Timer1_Timer ()
  184.     If (fConnected = False And MainForm.Ftp1.State = 1) Then
  185.         cmdDisconnect.Enabled = True
  186.         cmdConnect.Enabled = False
  187.         cmdReinit.Enabled = True
  188.         fConnected = True
  189.     ElseIf (fConnected = True And MainForm.Ftp1.State = 0) Then
  190.         cmdDisconnect.Enabled = Not True
  191.         cmdConnect.Enabled = Not False
  192.         cmdReinit.Enabled = Not True
  193.         fConnected = False
  194.     End If
  195. End Sub
  196.